import request from '@/utils/request'

// 查询报销记录（个人）列表
export function listRecord(query) {
  return request({
    url: '/reim/daily/record/list',
    method: 'get',
    params: query
  })
}

// 查询报销记录（个人）详细
export function getRecord(reimId) {
  return request({
    url: '/reim/daily/record/' + reimId,
    method: 'get'
  })
}

// 新增报销记录（个人）
export function addRecord(data) {
  return request({
    url: '/reim/daily/record',
    method: 'post',
    data: data
  })
}

// 修改报销记录（个人）
export function updateRecord(data) {
  return request({
    url: '/reim/daily/record',
    method: 'put',
    data: data
  })
}

// 删除报销记录（个人）
export function delRecord(reimId) {
  return request({
    url: '/reim/daily/record/' + reimId,
    method: 'delete'
  })
}

// 统计前确认数据
export function confirmStat(reimId) {
  return request({
    url: '/reim/daily/record/confirm/' + reimId,
    method: 'get'
  })
}

// 统计数据
export function statRecord(reimId) {
  return request({
    url: '/reim/daily/record/stat/' + reimId,
    method: 'get'
  })
}

// 导出支付记录
export function imgsRecord(reimId) {
  return request({
    url: '/reim/daily/record/imgs/' + reimId,
    method: 'get',
    responseType: 'blob'
  })
}

// 导出报销封面
export function coverRecord(reimId) {
  return request({
    url: '/reim/daily/record/cover/' + reimId,
    method: 'get',
    responseType: 'blob'
  })
}

// 将数据标记为报销完成
export function completeRecord(reimId) {
  return request({
    url: '/reim/daily/record/complete/' + reimId,
    method: 'get'
  })
}
